package com.tsh.erp.model;

import java.util.LinkedHashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import kiven.jee.model.StringIdObject;

//@Entity
@Table(name = "tbsys01role")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Role extends StringIdObject{
	private static final long serialVersionUID = 3112409687658659185L;

	private String name; // 权限标识名称
	private String displayName;// 显示名称
	private String desn;// 角色说明
	private int sortOrder;// 显示顺序

	private Set<User> users = new LinkedHashSet<User>();// 有序的关联对象集合

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDisplayName() {
		return displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public String getDesn() {
		return desn;
	}

	public void setDesn(String desn) {
		this.desn = desn;
	}

	public int getSortOrder() {
		return sortOrder;
	}

	public void setSortOrder(int sortOrder) {
		this.sortOrder = sortOrder;
	}

	/*
	@ManyToMany(mappedBy = "roles")
	*/
	public Set<User> getUsers() {
		return users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}

}
